|
|
@@ -9,11 +9,16 @@ user.invitation_code = User::INVITATION_CODES.first
|
9
|
9
|
user.admin = true
|
10
|
10
|
user.save!
|
11
|
11
|
|
|
12
|
+puts
|
|
13
|
+puts
|
|
14
|
+
|
12
|
15
|
unless user.agents.where(:name => "SF Weather Agent").exists?
|
13
|
16
|
Agent.build_for_type("Agents::WeatherAgent", user,
|
14
|
17
|
:name => "SF Weather Agent",
|
15
|
18
|
:schedule => "10pm",
|
16
|
|
- :options => { 'location' => "94103", 'api_key' => "your-key" }).save!
|
|
19
|
+ :options => { 'location' => "94103", 'api_key' => "put-your-key-here" }).save!
|
|
20
|
+
|
|
21
|
+ puts "NOTE: The example 'SF Weather Agent' will not work until you edit it and put in a free API key from http://www.wunderground.com/weather/api/"
|
17
|
22
|
end
|
18
|
23
|
|
19
|
24
|
unless user.agents.where(:name => "XKCD Source").exists?
|
|
|
@@ -25,7 +30,7 @@ unless user.agents.where(:name => "XKCD Source").exists?
|
25
|
30
|
'url' => "http://xkcd.com",
|
26
|
31
|
'mode' => "on_change",
|
27
|
32
|
'expected_update_period_in_days' => 5,
|
28
|
|
- 'extrac' => {
|
|
33
|
+ 'extract' => {
|
29
|
34
|
'url' => { 'css' => "#comic img", 'attr' => "src" },
|
30
|
35
|
'title' => { 'css' => "#comic img", 'attr' => "title" }
|
31
|
36
|
}
|
|
|
@@ -77,3 +82,5 @@ unless user.agents.where(:name => "Afternoon Digest").exists?
|
77
|
82
|
:options => { 'subject' => "Your Afternoon Digest", 'expected_receive_period_in_days' => "7" },
|
78
|
83
|
:source_ids => user.agents.where(:name => ["iTunes Trailer Source", "XKCD Source"]).pluck(:id)).save!
|
79
|
84
|
end
|
|
85
|
+
|
|
86
|
+puts "See the Huginn Wiki for more Agent examples! https://github.com/cantino/huginn/wiki"
|